home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
smaltalk
/
manchest.lha
/
MANCHESTER
/
manchester
/
4.1
/
Character-printOn.st
< prev
next >
Wrap
Text File
|
1993-07-24
|
974b
|
34 lines
" NAME Character-printOn
AUTHOR Bernard Horan <bernard@is.morgan.com>
CONTRIBUTOR Bernard Horan <bernard@is.morgan.com>
FUNCTION produce _useful_ representation of character instance
ST-VERSIONS 4.1
PREREQUISITES
CONFLICTS
DISTRIBUTION global
VERSION 1.0
DATE September 1992
SUMMARY Alternative method to print a character, possibly as an ascii value, if that value is non-alphabetic. BH, 28/9/92"
!
'From Objectworks\Smalltalk(R), Release 4.1 of 15 April 1992 on 1 September 1992 at 6:46:35 am'!
!Character methodsFor: 'printing'!
printOn: aStream
"If I am alphabetic, then append to the argument aStream a sequence of characters preceded by
the
literal $ that identifies the receiver; otherwise append my integer value (ascii).
Bernard Horan, 29 September 1992."
aStream nextPut: $$.
self isAlphabetic
ifTrue: [aStream nextPut: self]
ifFalse:
[aStream nextPut: ${.
self asInteger printOn: aStream.
aStream nextPut: $}]! !